home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-08-10 | 71.6 KB | 2,922 lines |
- #!/bin/sh
- # to extract, remove the header and type "sh filename"
- if `test ! -d ./doc`
- then
- mkdir ./doc
- echo "mkdir ./doc"
- fi
- if `test ! -s ./doc/TYLMAN.10`
- then
- echo "writing ./doc/TYLMAN.10"
- cat > ./doc/TYLMAN.10 << 'E_O_F'
- \chapter{Font Example}\label{font-examples}
- % macros for font tables
- \def\oct#1{\hbox{\rm\'{}\kern-.2em\it#1\/\kern.05em}} % octal constant
- \def\hex#1{\hbox{\rm\H{}\tt#1}} % hexadecimal constant
- \def\oddline#1{\cr
- \noalign{\nointerlineskip}
- \multispan{19}\hrulefill&
- \setbox0=\hbox{\lower 4pt\hbox{\hex{#1x}}}\smash{\box0}\cr%was 2.3pt
- \noalign{\nointerlineskip}}
- \def\evenline{\cr\noalign{\hrule}}
- \def\chartstrut{\lower4.5pt\vbox to20pt{}}%was 14pt
- \def\beginchart#1{$$\postdisplaypenalty=-10000 \global\count222=0 #1
- \halign to\hsize\bgroup
- \chartstrut##\tabskip0pt plus10pt&
- &\hfil##\hfil&\vrule##\cr
- \lower6.5pt\null
- &&&\oct0&&\oct1&&\oct2&&\oct3&&\oct4&&\oct5&&\oct6&&\oct7&\evenline}
- \def\endchart{\raise11.5pt\null&&&\hex 8&&\hex 9&&\hex A&&\hex B&
- &\hex C&&\hex D&&\hex E&&\hex F&\cr\egroup$$}
- \def\:{\setbox0=\hbox{\char\count222}%
- \ifdim\ht0>7.5pt\reposition
- \else\ifdim\dp0>2.5pt\reposition\fi\fi
- \box0\global\advance\count222 by1 }
- \def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}
- \def\normalchart{%
- &\oct{00x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline0
- &\oct{01x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
- &\oct{02x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline1
- &\oct{03x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
- &\oct{04x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline2
- &\oct{05x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
- &\oct{06x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline3
- &\oct{07x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
- &\oct{10x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline4
- &\oct{11x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
- &\oct{12x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline5
- &\oct{13x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
- &\oct{14x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline6
- &\oct{15x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline
- &\oct{16x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\oddline7
- &\oct{17x}&&\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\evenline}
- \font\cv=cvec3
- \vfill\eject
- \centerline{Example of |cvec3|}\par
- \beginchart{\cv}
- \normalchart
- \endchart
- %\vfill\eject
- %\Makeodd
- E_O_F
- else
- echo "will not over write ./doc/TYLMAN.10"
- fi
- chmod 644 ./doc/TYLMAN.10
- if [ `wc -c ./doc/TYLMAN.10 | awk '{printf $1}'` -ne 2082 ]
- then
- echo `wc -c ./doc/TYLMAN.10 | awk '{print "Got " $1 ", Expected " 2082}'`
- fi
- if `test ! -s ./doc/textyl.tex`
- then
- echo "writing ./doc/textyl.tex"
- cat > ./doc/textyl.tex << 'E_O_F'
- % Inclusion file for TeXtyl
- % This is textyl.tex
- %
- % John Renner (jsr@ohio-state.arpa)
- %
- % macros for figures for Tyling
- % specify :
- % \begintyl{vert_dimen}[optional_horiz_dimen]
- % (with NO intervening space between the } and the [ chars)
- % then the \special{tyl ...} strings
- % then you must finish environment with \endtyl
- %
- % \begintyl and \endtyl are the only
- % user-callable macros
- % See the TeXtyl manual for a complete explanation.
- \def\begintyl#1{\begingroup\endlinechar=-1\catcode `\^^I=9
- \dimen120=#1
- \ifhmode\toks0={\futurelet\tyltempb\begHtyl}
- \let\endtyl=\endHtyl
- \else\toks0={\futurelet\tyltempb\begVtyl}
- \let\endtyl=\endVtyl\fi
- \the\toks0}
- %
- %-------the rest are internal------
- \def\begHtyl{\ifx [\tyltempb \let\tylh=\tylHspace
- \else\let\tylh=\tylHnospace\fi\tylh}
- %
- \def\tylHspace[#1]{\setbox0=\hbox to #1\bgroup
- \vbox to \dimen120\bgroup\vss}
- \def\tylHnospace{\setbox0=\hbox\bgroup
- \vbox to \dimen120\bgroup\vss}
- %
- \def\begVtyl{\ifx [\tyltempb \let\tylv=\tylVspace
- \else\let\tylv=\tylVnospace\fi\tylv}
- %
- \def\tylVspace[#1]{\setbox0=\vbox to \dimen120\bgroup\vss
- \hbox to #1\bgroup}
- \def\tylVnospace{\setbox0=\vbox to \dimen120\bgroup\vss
- \hbox\bgroup}
- %
- \def\endHtyl{\egroup\hss\egroup\box0\endgroup}
- \def\endVtyl{\hss\egroup\egroup\box0\endgroup}
- E_O_F
- else
- echo "will not over write ./doc/textyl.tex"
- fi
- chmod 644 ./doc/textyl.tex
- if [ `wc -c ./doc/textyl.tex | awk '{printf $1}'` -ne 1292 ]
- then
- echo `wc -c ./doc/textyl.tex | awk '{print "Got " $1 ", Expected " 1292}'`
- fi
- if `test ! -s ./doc/TYLMAN.13`
- then
- echo "writing ./doc/TYLMAN.13"
- cat > ./doc/TYLMAN.13 << 'E_O_F'
- \begin{theindex}
- \newcommand{\largeletter}[1]{{\pagebreak[2]\Large\hspace{-.5in}\parbox[t]{.5in}{\makebox[.35in][r]{\uppercase{#1}}}\nopagebreak[4]\vspace{-1.5ex}}}
- \item {\tt "}-marker 19, 48
- \item {\tt .dvi} file 3
- \item {\tt .tex} text file 1, 3, 34
- \item {\tt .tlog} file 4, 23
- \item {\tt .tyl} file 23
- \item {\tt ?!} flag 24
- \item {\tt ?} flag 23
- \item {\tt @}-marker 8, 19
- \indexspace
- \largeletter{a}
- \item {\tt arc} 36
- \item {\bf arc} 19
- \item arcs 7
- \subitem angles 8, 19
- \subitem attributes 36
- \subitem center 8
- \subitem centering 8, 19
- \subitem circles 8, 36
- \subitem closed splines 36
- \subitem control points 31, 36
- \subitem ellipses 36
- \subitem example 8
- \subitem open 36
- \subitem open spline 36
- \subitem phantoming 37
- \subitem radius 8
- \subitem representation 31, 36
- \indexspace
- \largeletter{b}
- \item {\tt B}-marker 6, 14, 20
- \item B-spline basis 6, 20
- \item B-splines
- \subitem interpolating-type 6
- \subitem recomputing points 30
- \item {\bf beam} 22
- \item {\tt beam} 37
- \item beam-types 22
- \item beam font 29
- \subitem constraints 30
- \subitem design 29
- \subitem difference from vector font 29
- \subitem lengths 30
- \subitem range of angles 30
- \subitem relation to staff size 29
- \subitem sizes 29
- \subitem types 29
- \item beams 16
- \subitem attributes 37
- \subitem default size 22
- \subitem difference from lines 37
- \subitem sizes 22
- \subitem staff size 22
- \subitem typesetting 45
- \item {\bf beginfigure} 11, 22
- \item {\tt begintyl} 1, 3, 4, 12, 57
- \item bitmaps {\it\romannumeral 6}
- \item blank space 17
- \item bounding box 34, 38, 41
- \item boxes 1, 3, 9
- \indexspace
- \largeletter{c}
- \item {\tt C}-marker 20
- \item capabilities {\it\romannumeral 5}, {\it\romannumeral 6}, 17
- \item Cardinal basis 6, 20
- \item cartesian-space 2
- \item Catmull-Rom basis 20
- \item Catmull-Rom splines 5, 30
- \item circles 7, 8, 36
- \subitem control points 31, 36
- \subitem relation to arcs 36
- \subitem representation 31
- \item circular pen 20
- \item clamping 35, 43, 49
- \item closed splines 14, 20
- \item closure 20
- \item combining primitives 9, 10
- \item coordinates 2
- \subitem origin 2
- \item coordinate space system 19
- \item current position 1, 2, 3, 17
- \item curves 5
- \indexspace
- \largeletter{d}
- \item {\tt D}-marker 6, 20
- \item defaulting values 5
- \item defining fonts 46
- \item delimiters 6, 48
- \item design decisions 21, 27, 30
- \item design goals {\it\romannumeral 5}
- \item DVI {\it\romannumeral 5}
- \item DVI-filters 4
- \item DVI-space 35, 38, 43
- \item DVI file 27
- \subitem previewing 33
- \item DVI format 46
- \item DVI position coordinates 27
- \item DVISUN 33
- \item DVItype 27, 47
- \indexspace
- \largeletter{e}
- \item ellipses 19, 31, 36
- \subitem relation to circles 36
- \item {\tt endfigure} 42
- \item {\bf endfigure} 11, 22
- \item {\tt endtyl} 1, 12, 57
- \item errors
- \subitem internal 24
- \item extensions 49
- \indexspace
- \largeletter{f}
- \item {\tt F}-marker 22
- \item figure definitions 22
- \item figures 10
- \subitem context 41
- \subitem defining 11
- \subitem example 12
- \subitem examples 11
- \subitem fitting to size 22
- \subitem nested symbols 11
- \subitem preparation 2
- \subitem sub-figures 11
- \subitem tranforms 22
- \subitem transforms 10, 22
- \item fonts
- \subitem computing dimensions of 42
- \subitem defining 46
- \subitem font flag 46
- \subitem for labels 38
- \subitem numbering 43
- \subitem to be defined 46
- \indexspace
- \largeletter{g}
- \item {\tt G}-marker 16, 22
- \item geometric transforms 21
- \item Giuse{,} Dario 28, 49
- \item grace-notes 16
- \item graphic editors 17, 22
- \item grid-origin 3
- \indexspace
- \largeletter{h}
- \item {\tt H}-marker 20
- \item handlers 38
- \subitem design idea 39
- \subitem figurehandle 39
- \subitem functionality 38
- \subitem linehandle 38
- \subitem ttsplinehandle 38
- \item handling specials 27
- \item horizontal pen 20
- \indexspace
- \largeletter{i}
- \item {\tt I}-marker 6, 20
- \item Ideal {\it\romannumeral 5}
- \item {\tt input} 1
- \item interpolating B-spline 6
- \subitem basis 20
- \item item 39, 40
- \subitem inserting 41
- \subitem packing 40
- \subitem traversing 41
- \indexspace
- \largeletter{j}
- \item jaggies 36
- \indexspace
- \largeletter{k}
- \item {\tt K}-marker 5, 20
- \item keywords 6, 48
- \item Knuth{,} Donald 1
- \indexspace
- \largeletter{l}
- \item {\tt L}-marker 20
- \item {\tt label} 37
- \item {\bf label} 19
- \item labels
- \subitem face 19
- \subitem font face-styles 38
- \subitem font style 19
- \subitem strings 19
- \item {\LaTeX} 1, 3, 17, 51
- \subitem {\tt figure } environment 17
- \item {\tt layline} 43
- \item leaving no space 3
- \item leaving white space 3
- \item lies 37, 44
- \item {\tt line} 35
- \item {\bf line} 18
- \item line example 1
- \item line segments 18, 35
- \item line style 20, 34
- \subitem dashed 20
- \subitem dot-dashed 20
- \subitem dotted 20
- \subitem solid 20
- \item line styles
- \subitem examples 20
- \item line thickness 2, 18, 20, 31, 43
- \subitem example 20
- \item local maintainer 4, 25
- \item Lucas{,} Bruce 42
- \indexspace
- \largeletter{m}
- \item {\tt M}-marker 5, 6, 10
- \item {\tt M}-measure 19
- \item macro-expansion 33, 46
- \item macros 1, 9, 57
- \subitem {\it see} {\tt begintyl} 1
- \item markers 6
- \item measurement 19
- \subitem default 19
- \subitem default 22
- \subitem units 2
- \item Metafont 28, 42
- \subitem limitations 28
- \item millimeters 19
- \subitem measurement 5
- \item music {\it\romannumeral 5}, 21
- \item music font 29
- \item MusiCopy {\it\romannumeral 5}, 15, 42
- \indexspace
- \largeletter{n}
- \item Nelson{,} Bruce 28
- \item nested symbols 11
- \indexspace
- \largeletter{o}
- \item {\tt O}-marker 14, 20
- \item open spline 14, 20
- \item optional values 5
- \item origin 2
- \item origin of quadrant 17
- \item OSU 14
- \item output device 4, 49
- \subitem font memory 36
- \item oval
- \subitem {\it see} ellipse 19
- \indexspace
- \largeletter{p}
- \item {\tt P}-measure 19
- \item parameters to {\TT} 17
- \item Pascal 33
- \item pens 20
- \item phantom control points 37
- \item phantoming 37
- \item pixel thickness 20
- \item {\tt pop} 39
- \item postamble 47
- \item PostScript {\it\romannumeral 6}
- \item preamble 1
- \item preparing a figure 2
- \item primitive 2
- \item primitives 17, 34
- \subitem attributes 34
- \subitem built-up 17
- \subitem combining 9, 10
- \subitem definition of 40
- \subitem invoking 9
- \subitem modifying attributes 34
- \subitem names 48
- \subitem parameters 9, 18
- \subitem reduction of 34
- \subitem scaling; rot\-ating; trans\-lating 9
- \item printer's points 19
- \subitem measurement 2
- \item programmer's hook 43
- \item programs making figures 22
- \item {\tt push} 39
- \indexspace
- \largeletter{r}
- \item {\tt R}-marker 16, 22
- \item reference point 17
- \item rotation 9, 10
- \subitem using degrees measurement 10
- \item running {\TT} 3
- \indexspace
- \largeletter{s}
- \item {\tt S}-measure 19
- \item Saxe{,} James 28
- \item scaled points 19
- \item scaling 9
- \item slurs 15, 21, 30, 31
- \subitem {\it see also} ties 16
- \item space 1, 3, 51
- \item space macros 1
- \item special 38
- \item {\tt special} 2
- \item specials 2, 17, 27, 46, 57
- \subitem case insensitivity 6
- \subitem handling 33
- \subitem handling by {\TT} 27
- \subitem punctuation 6
- \subitem typing in 6
- \item {\tt spline} 35
- \item {\bf spline} 18
- \item spline
- \subitem B-spline 6
- \subitem Cardinal 6
- \subitem Catmull-Rom 5
- \subitem control-points 5
- \subitem coordinates 5
- \subitem default 5
- \subitem example 5
- \subitem Interpolating B-spline 6
- \subitem ttspline 6
- \item spline curves 5
- \item splines
- \subitem attributes 35
- \subitem B-spline 35
- \subsubitem example 15
- \subitem basis 20, 35
- \subitem Cardinal 35
- \subsubitem example 14
- \subitem Catmull-Rom 35
- \subsubitem example 14
- \subitem clamping 35
- \subitem closed 14
- \subitem closure 20
- \subitem default basis 20
- \subitem default closure 20
- \subitem default type 30
- \subitem families 30
- \subitem Interpolating B-spline
- \subsubitem example 15
- \subitem interpolation 30
- \subitem inversion 30
- \subitem open 14
- \subitem types 20
- \subitem typesetting 47
- \subitem use in simulating 37
- \item staff-size 16
- \item staff lines 37
- \item staff sizes 29, 37
- \item Standard{,} Paul {\it\romannumeral 1}
- \item sub-figures 11
- \item subdivision of splines 47
- \item surprise errors 24
- \item symbol
- \subitem {\it see} figure 22
- \indexspace
- \largeletter{t}
- \item {\tt T}-marker 10, 12
- \item {\TeX} {\it\romannumeral 5}, 1, 3, 17, 34, 51
- \item \TeX book 9
- \item {\TeX} commands 17, 51
- \item {\TT} {\it\romannumeral 5}
- \subitem {\tt .tlog} log-file 23
- \subitem error handling 23
- \subitem error messages 24
- \subitem error recovering 23
- \subitem how to read manual {\it\romannumeral 6}
- \subitem name {\it\romannumeral 5}
- \subitem parameters 17
- \subitem serious problems 26
- \subitem signatures 43, 48
- \subitem simple problem 25
- \item {\tt textyl.tex} file 1
- \item TFM information 27
- \item Thick-n-thin spline 6
- \item ties 15, 21, 30
- \subitem and ttsplines 16
- \subitem example 16
- \subitem {\it see also} slurs 16
- \item {\bf tieslur} 21
- \item {\tt tieslur} 35
- \item tieslur
- \subitem attributes 35
- \subitem clamping 35
- \subitem example 16
- \subitem implementation 31
- \subitem pen type 21
- \subitem relation to ttsplines 35
- \subitem representation 34
- \subitem thicknesses 16, 21
- \subitem vector type 21
- \item tranforms
- \subitem figure-level 22
- \item {\bf transform} 21
- \item transformations
- \subitem {\it see } transforms 21
- \item transforms 9
- \subitem additiveness 22, 42
- \subitem concatenation 11
- \subitem example 10
- \subitem figure-level 41
- \subitem mirroring 10
- \subitem no-op 10
- \subitem parameters 10, 21
- \subsubitem format 21
- \subsubitem requirement 21
- \subitem rotating 9
- \subitem scaling 9
- \subitem sub-figures 11
- \subitem top-level 42
- \subitem translation 9
- \item transform to DVI space 39
- \item translating 9
- \item {\tt ttspline} 35
- \item ttspline 6, 31
- \subitem clamping 35
- \subitem defaults 6
- \subitem example 6
- \subitem line thicknesses 31
- \subitem thicknesses 6, 18
- \item {\bf ttspline} 18
- \item tyling {\it\romannumeral 5}, 33, 37, 46
- \item {\tt tyl} name-string 2
- \item typing in special strings 6
- \indexspace
- \largeletter{u}
- \item {\tt U}-marker 14, 20
- \item units of measure 19
- \item Unix 33
- \item user's view 17
- \item user intuition 21
- \indexspace
- \largeletter{v}
- \item {\tt V}-marker 20
- \item vector-types 20
- \subitem default 20
- \item vector font 20, 28
- \subitem computing dimensions 28
- \subitem cvec 29
- \subitem dimensions 28
- \subitem mapping function 44
- \subitem path invariance 45
- \subitem pen-types 29
- \subitem pens
- \subsubitem example 29
- \subitem pixelsize 29
- \subitem range of angles 28
- \subitem sizes 29
- \subitem types 29
- \item vectors
- \subitem typesetting with 28
- \item vertical pen 20
- \indexspace
- \largeletter{w}
- \item {\tt W}-marker 22
- \indexspace
- \largeletter{x}
- \item {\tt X}-marker 18
- \indexspace
- \largeletter{z}
- \item Zapf{,} Hermann {\it\romannumeral 1}
- \end{theindex}
-
- \end{document}
- E_O_F
- else
- echo "will not over write ./doc/TYLMAN.13"
- fi
- chmod 644 ./doc/TYLMAN.13
- if [ `wc -c ./doc/TYLMAN.13 | awk '{printf $1}'` -ne 11122 ]
- then
- echo `wc -c ./doc/TYLMAN.13 | awk '{print "Got " $1 ", Expected " 11122}'`
- fi
- if `test ! -s ./doc/TYLMAN.12`
- then
- echo "writing ./doc/TYLMAN.12"
- cat > ./doc/TYLMAN.12 << 'E_O_F'
- \begin{thebibliography}{99}
- \typeout{bib}
- \bibitem{adobe}Adobe Systems Inc., {\it PostScript Language Reference Manual.}
- Addison-Wesley, Reading, MA, 1985.
-
- \bibitem{ahu}Alfred V. Aho, John E. Hopcroft, and Jeffrey D. Ullman, {\it
- The Design and Analysis of Computer Algorithms.} Addison-Wesley, Reading,
- Mass. 1974.
-
- \bibitem{barsky}Brian A. Barsky, and Donald P. Greenberg, ``Determining a
- Set of B-spline Control Vertices to Generate an Interpolating Surface.''
- {\it Computer Graphics and Image Processing.} {\bf 14} 3, (Nov. 1980), pp.203--226.
-
- \bibitem{cagd}Edwin E. Catmull, and Raphael J. Rom, ``A Class of Local
- Interpolating Splines.'' {\it Computer Aided Geometric Design.}
- Robert E. Barnhill and Richard F. Riesenfeld, eds.
- Academic Press, New York, NY, 1974, pp. 317--326.
-
- \bibitem{dvitype}David R. Fuchs, Howard Trickey, {\it The DVI$\,$type processor.} Program
- documentation, 1983--4.
-
- \bibitem{dario}Dario Giuse, {\it DP---Format of the drawing files.}
- Technical Report. Car\-negie -Mellon University Robotics Institute, 1983.
-
- \bibitem{gourlay}John S. Gourlay, ``A Language for Music Printing.''
- {\it Communications of the ACM\/} {\bf 29} 5, (May 1986), pp. 388--401.
-
- \bibitem{dvisun}Norm Hutchinson, et al. {\smallrm DVISUN} Program. 1983.
-
- \bibitem{knuth-tex82}Donald E. Knuth, {\it The \TeX book.} Addison-Wesley,
- Reading, Mass. 1984.
-
- \bibitem{knuth-mf}Donald E. Knuth, {\it \TeX\ and METAFONT: New Directions in
- Typesetting.} Digital Press, Bedford, MA, 1979.
-
- \bibitem{nelson-saxe}Bruce Nelson, and James Saxe, ``Drawing Splines with a
- Vector Font.''
- Unpublished technical report. Carnegie-Mellon University, 1980.
-
- \bibitem{ross}Ted Ross, {\it The Art of Music Engraving and Processing.}
- Hansen Books, 1970.
-
- \bibitem{updike}Daniel Berkeley Updike, {\it Printing Types: Their History,
- Forms, and Use.} Harvard University Press, Cambridge, MA, 1937.
-
- \bibitem{wu-abel}Sheng-Chuan Wu, John F. Abel, and Donald Greenberg,
- ``An Interactive Computer
- Graphics Approach to Surface Representation.''
- {\it Communications of the ACM\/} {\bf 20} 10, (Oct. 1977), pp. 703--712.
-
- \bibitem{vanwyk}Christopher J. Van Wyk, {\it A Language for Typesetting
- Graphics.} Ph.D. dissertation. Stanford University, 1980.
-
- \bibitem{zapf}Hermann Zapf, {\it The Printing Salesman's Herald.} Book 39.
- Champion Papers, New York, NY, 1978.
- \end{thebibliography}
- \Makeodd
- E_O_F
- else
- echo "will not over write ./doc/TYLMAN.12"
- fi
- chmod 644 ./doc/TYLMAN.12
- if [ `wc -c ./doc/TYLMAN.12 | awk '{printf $1}'` -ne 2375 ]
- then
- echo `wc -c ./doc/TYLMAN.12 | awk '{print "Got " $1 ", Expected " 2375}'`
- fi
- if `test ! -s ./doc/TYLMAN.11`
- then
- echo "writing ./doc/TYLMAN.11"
- cat > ./doc/TYLMAN.11 << 'E_O_F'
- \chapter{Macros and Extended Examples}\label{secapp}
- All of the thumbnail figures in this manual were created using the
- |\special{tyl...| strings\index{specials} as described, and were placed within an
- environment delimited by |\begintyl| and |\endtyl|.\index{{\tt
- begintyl}}\index{{\tt endtyl}} This environment allows
- the user to specify a vertical and optional horizontal offset from the
- ``current-position'' on the page. This determines where the origin of the
- user's coordinate system is to be placed. Also, this environment sets
- parameters so that the user can use tabbing and spacing to align the
- \hbox{|\special|} strings as he desires (e.g., to better show the nesting of
- figures and graphic-primitives). The macros\index{macros} used are defined
- below:
- \vspace*{-20pt}
-
- \bgroup\footnotesize
- \begin{verbatim}
- % This is textyl.tex
- %
- % macros for figures for Tyling
- % specify :
- % \begintyl{vert_dimen}[optional_horiz_dimen]
- % (with NO intervening space between the } and the [ chars)
- % then the \special{tyl ...} strings
- % then you must finish environment with \endtyl
- %
- \def\begintyl#1{\begingroup\endlinechar=-1\catcode `\^^I=9
- \dimen120=#1
- \ifhmode\toks0={\futurelet\tyltempb\begHtyl}
- \let\endtyl=\endHtyl
- \else\toks0={\futurelet\tyltempb\begVtyl}
- \let\endtyl=\endVtyl\fi
- \the\toks0}
- \def\begHtyl{\ifx [\tyltempb \let\tylh=\tylHspace
- \else\let\tylh=\tylHnospace\fi\tylh}
- %
- \def\tylHspace[#1]{\setbox0=\hbox to #1\bgroup
- \vbox to \dimen120\bgroup\vss}
- \def\tylHnospace{\setbox0=\hbox\bgroup
- \vbox to \dimen120\bgroup\vss}
- %
- \def\begVtyl{\ifx [\tyltempb \let\tylv=\tylVspace
- \else\let\tylv=\tylVnospace\fi\tylv}
- %
- \def\tylVspace[#1]{\setbox0=\vbox to \dimen120\bgroup\vss
- \hbox to #1\bgroup}
- \def\tylVnospace{\setbox0=\vbox to \dimen120\bgroup\vss
- \hbox\bgroup}
- %
- \def\endHtyl{\egroup\hss\egroup\box0\endgroup}
- \def\endVtyl{\hss\egroup\egroup\box0\endgroup}
- \end{verbatim}
-
- \egroup
- \par
- Let's look at a non-trivial example of frequently-used figures. The
- original figure is from \cite{ahu}, page 325. I'll give the diagram, and then
- the annotated |\special| commands.\par
- \begintyl{9cm}
- \special{tyl begin /AHU=fig=9.7/}
- \special{tyl arc m 2 6 @ 10 46 10 10 /state=s1/}
- \special{tyl label m 5 9 46 "s1"}
- \special{tyl arc m 2 6 @ 62 20 10 10 /state=s2/}
- \special{tyl lab m 5 61 20 "s2"}
- \special{tyl arc m 2 6 @ 62 60 10 10 /state=s3/}
- \special{tyl lab m 5 61 60 "s3"}
- \special{tyl arc m 2 6 @ 104 34 10 10 /finalstate=s4/}
- \special{tyl arc m 2 8 @ 104 34 10 10}
- \special{tyl lab m 5 103 34 "s4"}
- %now draw the connectors
- \special{tyl line m 3 16 48 56 59 /s1-s2/}
- \special{tyl lab m 1 30 53 "a"}
- \special{tyl line m 3 56 59 53 60}% and the arrow
- \special{tyl line m 3 56 59 54 57}
- \special{tyl line m 3 53 60 54 57}
-
- \special{tyl line m 3 15 43 56 23 /s1-s3/}
- \special{tyl lab m 1 32 30 "e"}
- \special{tyl line m 3 56 23 55 25}
- \special{tyl line m 3 56 23 53 23}
- \special{tyl line m 3 55 25 53 23}
-
- \special{tyl spline m 3 4 12 52; 62 76; 90,63; 105,44 /s1-s4/}
- \special{tyl lab m 1 70 78 "b"}
- \special{tyl line m 3 105,42 106 44}
- \special{tyl line m 3 105 42 104 44}
- \special{tyl line m 3 104 44 106 44}
-
- \special{tyl line m 3 62 26 62 54 /s3-s2/}
- \special{tyl lab m 1 64 38 "b"}
- \special{tyl line m 3 62 54 64 52}
- \special{tyl line m 3 62 54 60 52}
- \special{tyl line m 3 60 52 64 52}
-
- \special{tyl spline m 3 3 67 55; 80 42; 96 36 /s3-s4/}
- \special{tyl lab m 1 76 40 "e"}
- \special{tyl line m 3 96 36 95 38}
- \special{tyl line m 3 96 36 95 35}
- \special{tyl line m 3 95 35 95 38}
-
- \special{tyl spline m 3 3 69 61; 86 52; 98 40 /s4-s3/}
- \special{tyl lab m 1 89 51 "a"}
- \special{tyl line m 3 69 61 71 62}
- \special{tyl line m 3 69 61 70 59}
- \special{tyl line m 3 70 59 71 62}
-
- \special{tyl line m 3 69 22 96 32 /s2-s4/}
- \special{tyl lab m 1 82 24 "e"}
- \special{tyl line m 3 96 32, 94 33}
- \special{tyl line m 3 96 32 95 30}
- \special{tyl line m 3 94 33 95 30}
- \special{tyl endfigure}
- \endtyl\par
- And the text to produce this is:
-
- \bgroup\footnotesize
- \begin{verbatim}
- \begintyl{9cm}
- \special{tyl begin /AHU=fig=9.7/}
- \special{tyl arc m 2 6 @ 10 46 10 10 /state=s1/}
- \special{tyl label m 5 9 46 "s1"}
- \special{tyl arc m 2 6 @ 62 20 10 10 /state=s2/}
- \special{tyl lab m 5 61 20 "s2"}
- \special{tyl arc m 2 6 @ 62 60 10 10 /state=s3/}
- \special{tyl lab m 5 61 60 "s3"}
- \special{tyl arc m 2 6 @ 104 34 10 10 /finalstate=s4/}
- \special{tyl arc m 2 8 @ 104 34 10 10}
- \special{tyl lab m 5 103 34 "s4"}
- %now draw the connectors
- \special{tyl line m 3 16 48 56 59 /s1-s2/}
- \special{tyl lab m 1 30 53 "a"}
- \special{tyl line m 3 56 59 53 60}% and the arrow
- \special{tyl line m 3 56 59 54 57}
- \special{tyl line m 3 53 60 54 57}
-
- \special{tyl line m 3 15 43 56 23 /s1-s3/}
- \special{tyl lab m 1 32 30 "e"}
- \special{tyl line m 3 56 23 55 25}
- \special{tyl line m 3 56 23 53 23}
- \special{tyl line m 3 55 25 53 23}
-
- \special{tyl spline m 3 4 12 52; 62 76; 90,63; 105,44 /s1-s4/}
- \special{tyl lab m 1 70 78 "b"}
- \special{tyl line m 3 105,42 106 44}
- \special{tyl line m 3 105 42 104 44}
- \special{tyl line m 3 104 44 106 44}
-
- \special{tyl line m 3 62 26 62 54 /s3-s2/}
- \special{tyl lab m 1 64 38 "b"}
- \special{tyl line m 3 62 54 64 52}
- \special{tyl line m 3 62 54 60 52}
- \special{tyl line m 3 60 52 64 52}
-
- \special{tyl spline m 3 3 67 55; 80 42; 96 36 /s3-s4/}
- \special{tyl lab m 1 76 40 "e"}
- \special{tyl line m 3 96 36 95 38}
- \special{tyl line m 3 96 36 95 35}
- \special{tyl line m 3 95 35 95 38}
-
- \special{tyl spline m 3 3 69 61; 86 52; 98 40 /s4-s3/}
- \special{tyl lab m 1 89 51 "a"}
- \special{tyl line m 3 69 61 71 62}
- \special{tyl line m 3 69 61 70 59}
- \special{tyl line m 3 70 59 71 62}
-
- \special{tyl line m 3 69 22 96 32 /s2-s4/}
- \special{tyl lab m 1 82 24 "e"}
- \special{tyl line m 3 96 32, 94 33}
- \special{tyl line m 3 96 32 95 30}
- \special{tyl line m 3 94 33 95 30}
- \special{tyl endfigure}
- \endtyl\par
- \end{verbatim}
-
- \egroup
- \vfill
- \Makeodd
- E_O_F
- else
- echo "will not over write ./doc/TYLMAN.11"
- fi
- chmod 644 ./doc/TYLMAN.11
- if [ `wc -c ./doc/TYLMAN.11 | awk '{printf $1}'` -ne 6185 ]
- then
- echo `wc -c ./doc/TYLMAN.11 | awk '{print "Got " $1 ", Expected " 6185}'`
- fi
- if `test ! -d ./src`
- then
- mkdir ./src
- echo "mkdir ./src"
- fi
- if `test ! -s ./src/texpaths.h`
- then
- echo "writing ./src/texpaths.h"
- cat > ./src/texpaths.h << 'E_O_F'
- /*
- * This file defines the default paths that will be used for TeX software.
- * (These paths are used if the user's environment doesn't specify paths.)
- *
- * Paths should be colon-separated and no longer than MAXINPATHCHARS-1
- * (for defaultinputpath) or MAXOTHPATHCHARS (for other default paths).
- */
-
- #define MAXINPATHCHARS 700 /* maximum number of chars in an input path */
-
- #define defaultinputpath ".:/usr/lib/tex/macros"
- /* this should always start with "." */
-
- #define MAXOTHPATHCHARS 100 /* other paths should be much shorter */
-
- #define defaultfontpath "/usr/lib/tex/fonts"
- /* it is probably best not to include "." here to prevent confusion
- by spooled device drivers that think they know where the fonts
- really are */
- #define defaultformatpath ".:/usr/lib/tex/ctex/macros"
- #define defaultpoolpath ".:/usr/lib/tex"
-
- /*---------------------------------------------------------
- The following is for TeXtyl: the default directory where
- the .tfm files for the vector fonts can be found.
- it needs the trailing slash , and must be *single*
- quoted since Pascal delimits strings that way.
- */
-
- #define TYLPATH '/usr/lib/tex/fonts/'
- /* The length of the above TYLPATH string */
- #define TYLPATHLEN 19
- E_O_F
- else
- echo "will not over write ./src/texpaths.h"
- fi
- chmod 644 ./src/texpaths.h
- if [ `wc -c ./src/texpaths.h | awk '{printf $1}'` -ne 1243 ]
- then
- echo `wc -c ./src/texpaths.h | awk '{print "Got " $1 ", Expected " 1243}'`
- fi
- if `test ! -s ./src/textyl.pas.ac`
- then
- echo "writing ./src/textyl.pas.ac"
- cat > ./src/textyl.pas.ac << 'E_O_F'
- k := r + 5;
- end;
- 3: begin (* cmsl10 *)
- labtfmnam.str[r + 3] := 's';
- labtfmnam.str[r + 4] := 'l';
- labtfmnam.str[r + 5] := '1';
- labtfmnam.str[r + 6] := '0';
- k := r + 6;
- end;
- 4: begin (* cmtt8 *)
- labtfmnam.str[r + 3] := 't';
- labtfmnam.str[r + 4] := 't';
- labtfmnam.str[r + 5] := '8';
- k := r + 5;
- end;
- 5: begin (* cmsl8 *)
- labtfmnam.str[r + 3] := 's';
- labtfmnam.str[r + 4] := 'l';
- labtfmnam.str[r + 5] := '8';
- k := r + 5;
- end;
- end; (* case *)
- labtfmnam.str[k + 1] := '.';
- labtfmnam.str[k + 2] := 't';
- labtfmnam.str[k + 3] := 'f';
- labtfmnam.str[k + 4] := 'm';
-
- labtfmnam.str[k+5] := chr(32);
-
- labtfmnam.len := k + 4;
-
- gettfm (labtfmnam, design, p1, space, p3, p4, p5, p6, p7, cksm);
-
- LFontsDefd := LFontsDefd + 1;
-
- if (LFontsDefd > SizLFontTable) then
- begin
- complain (ERRREALBAD);
- writestrng(labtfmnam, true);
- writeln(logfile,'---not loadable. Size of Label Font table too small');
- writestrng(labtfmnam,false);
- writeln(' cannot be loaded. Too many label fonts. Table too small.');
- jumpout;
- end;
-
- i := LFontsDefd;
- new (LFontTable[i]);
- with LFontTable[i]^ do
- begin
- strcopy (labtfmnam.str, FontName.str, labtfmnam.len);
- FontName.len := labtfmnam.len;
- Cksum := cksm;
- DesSize := design;
- internalnumber := style;
- spacewidth := space;
- DVIFontNum := GDVIFN +1;
- Isdefined := false;
- end; (* with *)
-
- GDVIFN := GDVIFN + 1;
- fonttobedefined ('L', i);
- GetLabFont := i;
- 99:
- end;
-
-
- {------------------------------------------------}
- function vectangle (dx, dy : integer) :real;
- begin
- if (dx <> 0) then
- vectangle := arctan (dy / (dx * 1.0)) * RADTODEG
- else
- begin
- if (dy > 0) then
- vectangle := 90.0
- else
- vectangle := -90.0;
- end;
- end;
-
-
- {-----------------------------------------------------------}
- procedure definevectors (* var Vec: pVectFontInfRec *);
- var units : real;
- begin
- units := Vec^.MaxVectLen / 16.0;
- with Vec^.FontInfo[ 0] do begin
- Cht := round( 15.9688 * units);
- Cdp := 0;
- Cwd := round( 0.9981 * units);
- Angle := 86.4237;
- end;
-
- with Vec^.FontInfo[ 1] do begin
- Cht := round( 15.8764 * units);
- Cdp := 0;
- Cwd := round( 1.9846 * units);
- Angle := 82.8750;
- end;
-
- with Vec^.FontInfo[ 2] do begin
- Cht := round( 15.7260 * units);
- Cdp := 0;
- Cwd := round( 2.9486 * units);
- Angle := 79.3803;
- end;
-
- with Vec^.FontInfo[ 3] do begin
- Cht := round( 15.5223 * units);
- Cdp := 0;
- Cwd := round( 3.8806 * units);
- Angle := 75.9638;
- end;
-
- with Vec^.FontInfo[ 4] do begin
- Cht := round( 15.2717 * units);
- Cdp := 0;
- Cwd := round( 4.7724 * units);
- Angle := 72.6460;
- end;
-
- with Vec^.FontInfo[ 5] do begin
- Cht := round( 14.9813 * units);
- Cdp := 0;
- Cwd := round( 5.6180 * units);
- Angle := 69.4440;
- end;
-
- with Vec^.FontInfo[ 6] do begin
- Cht := round( 14.6585 * units);
- Cdp := 0;
- Cwd := round( 6.4131 * units);
- Angle := 66.3706;
- end;
-
- with Vec^.FontInfo[ 7] do begin
- Cht := round( 14.3108 * units);
- Cdp := 0;
- Cwd := round( 7.1554 * units);
- Angle := 63.4349;
- end;
-
- with Vec^.FontInfo[ 8] do begin
- Cht := round( 13.9452 * units);
- Cdp := 0;
- Cwd := round( 7.8442 * units);
- Angle := 60.6422;
- end;
-
- with Vec^.FontInfo[ 9] do begin
- Cht := round( 13.5680 * units);
- Cdp := 0;
- Cwd := round( 8.4800 * units);
- Angle := 57.9946;
- end;
-
- with Vec^.FontInfo[ 10] do begin
- Cht := round( 13.1847 * units);
- Cdp := 0;
- Cwd := round( 9.0645 * units);
- Angle := 55.4915;
- end;
-
- with Vec^.FontInfo[ 11] do begin
- Cht := round( 12.8000 * units);
- Cdp := 0;
- Cwd := round( 9.6000 * units);
- Angle := 53.1301;
- end;
-
- with Vec^.FontInfo[ 12] do begin
- Cht := round( 12.4178 * units);
- Cdp := 0;
- Cwd := round( 10.0895 * units);
- Angle := 50.9061;
- end;
-
- with Vec^.FontInfo[ 13] do begin
- Cht := round( 12.0412 * units);
- Cdp := 0;
- Cwd := round( 10.5361 * units);
- Angle := 48.8141;
- end;
-
- with Vec^.FontInfo[ 14] do begin
- Cht := round( 11.6726 * units);
- Cdp := 0;
- Cwd := round( 10.9431 * units);
- Angle := 46.8476;
- end;
-
- with Vec^.FontInfo[ 15] do begin
- Cht := round( 11.3137 * units);
- Cdp := 0;
- Cwd := round( 11.3137 * units);
- Angle := 45.0000;
- end;
-
- with Vec^.FontInfo[ 16] do begin
- Cht := round( 10.9431 * units);
- Cdp := 0;
- Cwd := round( 11.6726 * units);
- Angle := 43.1524;
- end;
-
- with Vec^.FontInfo[ 17] do begin
- Cht := round( 10.5361 * units);
- Cdp := 0;
- Cwd := round( 12.0412 * units);
- Angle := 41.1859;
- end;
-
- with Vec^.FontInfo[ 18] do begin
- Cht := round( 10.0895 * units);
- Cdp := 0;
- Cwd := round( 12.4178 * units);
- Angle := 39.0939;
- end;
-
- with Vec^.FontInfo[ 19] do begin
- Cht := round( 9.6000 * units);
- Cdp := 0;
- Cwd := round( 12.8000 * units);
- Angle := 36.8699;
- end;
-
- with Vec^.FontInfo[ 20] do begin
- Cht := round( 9.0645 * units);
- Cdp := 0;
- Cwd := round( 13.1847 * units);
- Angle := 34.5085;
- end;
-
- with Vec^.FontInfo[ 21] do begin
- Cht := round( 8.4800 * units);
- Cdp := 0;
- Cwd := round( 13.5680 * units);
- Angle := 32.0054;
- end;
-
- with Vec^.FontInfo[ 22] do begin
- Cht := round( 7.8442 * units);
- Cdp := 0;
- Cwd := round( 13.9452 * units);
- Angle := 29.3578;
- end;
-
- with Vec^.FontInfo[ 23] do begin
- Cht := round( 7.1554 * units);
- Cdp := 0;
- Cwd := round( 14.3108 * units);
- Angle := 26.5651;
- end;
-
- with Vec^.FontInfo[ 24] do begin
- Cht := round( 6.4131 * units);
- Cdp := 0;
- Cwd := round( 14.6585 * units);
- Angle := 23.6294;
- end;
-
- with Vec^.FontInfo[ 25] do begin
- Cht := round( 5.6180 * units);
- Cdp := 0;
- Cwd := round( 14.9813 * units);
- Angle := 20.5560;
- end;
-
- with Vec^.FontInfo[ 26] do begin
- Cht := round( 4.7724 * units);
- Cdp := 0;
- Cwd := round( 15.2717 * units);
- Angle := 17.3540;
- end;
-
- with Vec^.FontInfo[ 27] do begin
- Cht := round( 3.8806 * units);
- Cdp := 0;
- Cwd := round( 15.5223 * units);
- Angle := 14.0362;
- end;
-
- with Vec^.FontInfo[ 28] do begin
- Cht := round( 2.9486 * units);
- Cdp := 0;
- Cwd := round( 15.7260 * units);
- Angle := 10.6197;
- end;
-
- with Vec^.FontInfo[ 29] do begin
- Cht := round( 1.9846 * units);
- Cdp := 0;
- Cwd := round( 15.8764 * units);
- Angle := 7.1250;
- end;
-
- with Vec^.FontInfo[ 30] do begin
- Cht := round( 0.9981 * units);
- Cdp := 0;
- Cwd := round( 15.9688 * units);
- Angle := 3.5763;
- end;
-
- with Vec^.FontInfo[ 31] do begin
- Cht := 0;
- Cdp := 0;
- Cwd := round( 16.0000 * units);
- Angle := 0.0000;
- end;
-
- with Vec^.FontInfo[ 32] do begin
- Cdp := round( 0.9981 * units);
- Cht := 0;
- Cwd := round( 15.9688 * units);
- Angle := -3.5763;
- end;
-
- with Vec^.FontInfo[ 33] do begin
- Cdp := round( 1.9846 * units);
- Cht := 0;
- Cwd := round( 15.8764 * units);
- Angle := -7.1250;
- end;
-
- with Vec^.FontInfo[ 34] do begin
- Cdp := round( 2.9486 * units);
- Cht := 0;
- Cwd := round( 15.7260 * units);
- Angle := -10.6197;
- end;
-
- with Vec^.FontInfo[ 35] do begin
- Cdp := round( 3.8806 * units);
- Cht := 0;
- Cwd := round( 15.5223 * units);
- Angle := -14.0362;
- end;
-
- with Vec^.FontInfo[ 36] do begin
- Cdp := round( 4.7724 * units);
- Cht := 0;
- Cwd := round( 15.2717 * units);
- Angle := -17.3540;
- end;
-
- with Vec^.FontInfo[ 37] do begin
- Cdp := round( 5.6180 * units);
- Cht := 0;
- Cwd := round( 14.9813 * units);
- Angle := -20.5560;
- end;
-
- with Vec^.FontInfo[ 38] do begin
- Cdp := round( 6.4131 * units);
- Cht := 0;
- Cwd := round( 14.6585 * units);
- Angle := -23.6294;
- end;
-
- with Vec^.FontInfo[ 39] do begin
- Cdp := round( 7.1554 * units);
- Cht := 0;
- Cwd := round( 14.3108 * units);
- Angle := -26.5651;
- end;
-
- with Vec^.FontInfo[ 40] do begin
- Cdp := round( 7.8442 * units);
- Cht := 0;
- Cwd := round( 13.9452 * units);
- Angle := -29.3578;
- end;
-
- with Vec^.FontInfo[ 41] do begin
- Cdp := round( 8.4800 * units);
- Cht := 0;
- Cwd := round( 13.5680 * units);
- Angle := -32.0054;
- end;
-
- with Vec^.FontInfo[ 42] do begin
- Cdp := round( 9.0645 * units);
- Cht := 0;
- Cwd := round( 13.1847 * units);
- Angle := -34.5085;
- end;
-
- with Vec^.FontInfo[ 43] do begin
- Cdp := round( 9.6000 * units);
- Cht := 0;
- Cwd := round( 12.8000 * units);
- Angle := -36.8699;
- end;
-
- with Vec^.FontInfo[ 44] do begin
- Cdp := round( 10.0895 * units);
- Cht := 0;
- Cwd := round( 12.4178 * units);
- Angle := -39.0939;
- end;
-
- with Vec^.FontInfo[ 45] do begin
- Cdp := round( 10.5361 * units);
- Cht := 0;
- Cwd := round( 12.0412 * units);
- Angle := -41.1859;
- end;
-
- with Vec^.FontInfo[ 46] do begin
- Cdp := round( 10.9431 * units);
- Cht := 0;
- Cwd := round( 11.6726 * units);
- Angle := -43.1524;
- end;
-
- with Vec^.FontInfo[ 47] do begin
- Cdp := round( 11.3137 * units);
- Cht := 0;
- Cwd := round( 11.3137 * units);
- Angle := -45.0000;
- end;
-
- with Vec^.FontInfo[ 48] do begin
- Cdp := round ( 11.6726 * units);
- Cht := 0;
- Cwd := round( 10.9431 * units);
- Angle := -46.8476;
- end;
-
- with Vec^.FontInfo[ 49] do begin
- Cdp := round ( 12.0412 * units);
- Cht := 0;
- Cwd := round( 10.5361 * units);
- Angle := -48.8141;
- end;
-
- with Vec^.FontInfo[ 50] do begin
- Cdp := round ( 12.4178 * units);
- Cht := 0;
- Cwd := round( 10.0895 * units);
- Angle := -50.9061;
- end;
-
- with Vec^.FontInfo[ 51] do begin
- Cdp := round ( 12.8000 * units);
- Cht := 0;
- Cwd := round( 9.6000 * units);
- Angle := -53.1301;
- end;
-
- with Vec^.FontInfo[ 52] do begin
- Cdp := round ( 13.1847 * units);
- Cht := 0;
- Cwd := round( 9.0645 * units);
- Angle := -55.4915;
- end;
-
- with Vec^.FontInfo[ 53] do begin
- Cdp := round ( 13.5680 * units);
- Cht := 0;
- Cwd := round( 8.4800 * units);
- Angle := -57.9946;
- end;
-
- with Vec^.FontInfo[ 54] do begin
- Cdp := round ( 13.9452 * units);
- Cht := 0;
- Cwd := round( 7.8442 * units);
- Angle := -60.6422;
- end;
-
- with Vec^.FontInfo[ 55] do begin
- Cdp := round ( 14.3108 * units);
- Cht := 0;
- Cwd := round( 7.1554 * units);
- Angle := -63.4349;
- end;
-
- with Vec^.FontInfo[ 56] do begin
- Cdp := round ( 14.6585 * units);
- Cht := 0;
- Cwd := round( 6.4131 * units);
- Angle := -66.3706;
- end;
-
- with Vec^.FontInfo[ 57] do begin
- Cdp := round ( 14.9813 * units);
- Cht := 0;
- Cwd := round( 5.6180 * units);
- Angle := -69.4440;
- end;
-
- with Vec^.FontInfo[ 58] do begin
- Cdp := round ( 15.2717 * units);
- Cht := 0;
- Cwd := round( 4.7724 * units);
- Angle := -72.6460;
- end;
-
- with Vec^.FontInfo[ 59] do begin
- Cdp := round ( 15.5223 * units);
- Cht := 0;
- Cwd := round( 3.8806 * units);
- Angle := -75.9638;
- end;
-
- with Vec^.FontInfo[ 60] do begin
- Cdp := round ( 15.7260 * units);
- Cht := 0;
- Cwd := round( 2.9486 * units);
- Angle := -79.3803;
- end;
-
- with Vec^.FontInfo[ 61] do begin
- Cdp := round ( 15.8764 * units);
- Cht := 0;
- Cwd := round( 1.9846 * units);
- Angle := -82.8750;
- end;
-
- with Vec^.FontInfo[ 62] do begin
- Cdp := round ( 15.9688 * units);
- Cht := 0;
- Cwd := round( 0.9981 * units);
- Angle := -86.4237;
- end;
-
- with Vec^.FontInfo[ 63] do begin
- Cht := round( 8.0000 * units);
- Cdp := 0;
- Cwd := 0;
- Angle := 90.0000;
- end;
-
- with Vec^.FontInfo[ 64] do begin
- Cht := round( 7.9382 * units);
- Cdp := 0;
- Cwd := round( 0.9923 * units);
- Angle := 82.8750;
- end;
-
- with Vec^.FontInfo[ 65] do begin
- Cht := round( 7.7611 * units);
- Cdp := 0;
- Cwd := round( 1.9403 * units);
- Angle := 75.9638;
- end;
-
- with Vec^.FontInfo[ 66] do begin
- Cht := round( 7.4906 * units);
- Cdp := 0;
- Cwd := round( 2.8090 * units);
- Angle := 69.4440;
- end;
-
- with Vec^.FontInfo[ 67] do begin
- Cht := round( 7.1554 * units);
- Cdp := 0;
- Cwd := round( 3.5777 * units);
- Angle := 63.4349;
- end;
-
- with Vec^.FontInfo[ 68] do begin
- Cht := round( 6.7840 * units);
- Cdp := 0;
- Cwd := round( 4.2400 * units);
- Angle := 57.9946;
- end;
-
- with Vec^.FontInfo[ 69] do begin
- Cht := round( 6.4000 * units);
- Cdp := 0;
- Cwd := round( 4.8000 * units);
- Angle := 53.1301;
- end;
-
- with Vec^.FontInfo[ 70] do begin
- Cht := round( 6.0206 * units);
- Cdp := 0;
- Cwd := round( 5.2680 * units);
- Angle := 48.8141;
- end;
-
- with Vec^.FontInfo[ 71] do begin
- Cht := round( 5.6569 * units);
- Cdp := 0;
- Cwd := round( 5.6569 * units);
- Angle := 45.0000;
- end;
-
- with Vec^.FontInfo[ 72] do begin
- Cht := round( 5.2680 * units);
- Cdp := 0;
- Cwd := round( 6.0206 * units);
- Angle := 41.1859;
- end;
-
- with Vec^.FontInfo[ 73] do begin
- Cht := round( 4.8000 * units);
- Cdp := 0;
- Cwd := round( 6.4000 * units);
- Angle := 36.8699;
- end;
-
- with Vec^.FontInfo[ 74] do begin
- Cht := round( 4.2400 * units);
- Cdp := 0;
- Cwd := round( 6.7840 * units);
- Angle := 32.0054;
- end;
-
- with Vec^.FontInfo[ 75] do begin
- Cht := round( 3.5777 * units);
- Cdp := 0;
- Cwd := round( 7.1554 * units);
- Angle := 26.5651;
- end;
-
- with Vec^.FontInfo[ 76] do begin
- Cht := round( 2.8090 * units);
- Cdp := 0;
- Cwd := round( 7.4906 * units);
- Angle := 20.5560;
- end;
-
- with Vec^.FontInfo[ 77] do begin
- Cht := round( 1.9403 * units);
- Cdp := 0;
- Cwd := round( 7.7611 * units);
- Angle := 14.0362;
- end;
-
- with Vec^.FontInfo[ 78] do begin
- Cht := round( 0.9923 * units);
- Cdp := 0;
- Cwd := round( 7.9382 * units);
- Angle := 7.1250;
- end;
-
- with Vec^.FontInfo[ 79] do begin
- Cht := 0;
- Cdp := 0;
- Cwd := round( 8.0000 * units);
- Angle := 0.0000;
- end;
-
- with Vec^.FontInfo[ 80] do begin
- Cdp := round( 0.9923 * units);
- Cht := 0;
- Cwd := round( 7.9382 * units);
- Angle := -7.1250;
- end;
-
- with Vec^.FontInfo[ 81] do begin
- Cdp := round( 1.9403 * units);
- Cht := 0;
- Cwd := round( 7.7611 * units);
- Angle := -14.0362;
- end;
-
- with Vec^.FontInfo[ 82] do begin
- Cdp := round( 2.8090 * units);
- Cht := 0;
- Cwd := round( 7.4906 * units);
- Angle := -20.5560;
- end;
-
- with Vec^.FontInfo[ 83] do begin
- Cdp := round( 3.5777 * units);
- Cht := 0;
- Cwd := round( 7.1554 * units);
- Angle := -26.5651;
- end;
-
- with Vec^.FontInfo[ 84] do begin
- Cdp := round( 4.2400 * units);
- Cht := 0;
- Cwd := round( 6.7840 * units);
- Angle := -32.0054;
- end;
-
- with Vec^.FontInfo[ 85] do begin
- Cdp := round( 4.8000 * units);
- Cht := 0;
- Cwd := round( 6.4000 * units);
- Angle := -36.8699;
- end;
-
- with Vec^.FontInfo[ 86] do begin
- Cdp := round( 5.2680 * units);
- Cht := 0;
- Cwd := round( 6.0206 * units);
- Angle := -41.1859;
- end;
-
- with Vec^.FontInfo[ 87] do begin
- Cdp := round( 5.6569 * units);
- Cht := 0;
- Cwd := round( 5.6569 * units);
- Angle := -45.0000;
- end;
-
- with Vec^.FontInfo[ 88] do begin
- Cdp := round ( 6.0206 * units);
- Cht := 0;
- Cwd := round( 5.2680 * units);
- Angle := -48.8141;
- end;
-
- with Vec^.FontInfo[ 89] do begin
- Cdp := round ( 6.4000 * units);
- Cht := 0;
- Cwd := round( 4.8000 * units);
- Angle := -53.1301;
- end;
-
- with Vec^.FontInfo[ 90] do begin
- Cdp := round ( 6.7840 * units);
- Cht := 0;
- Cwd := round( 4.2400 * units);
- Angle := -57.9946;
- end;
-
- with Vec^.FontInfo[ 91] do begin
- Cdp := round ( 7.1554 * units);
- Cht := 0;
- Cwd := round( 3.5777 * units);
- Angle := -63.4349;
- end;
-
- with Vec^.FontInfo[ 92] do begin
- Cdp := round ( 7.4906 * units);
- Cht := 0;
- Cwd := round( 2.8090 * units);
- Angle := -69.4440;
- end;
-
- with Vec^.FontInfo[ 93] do begin
- Cdp := round ( 7.7611 * units);
- Cht := 0;
- Cwd := round( 1.9403 * units);
- Angle := -75.9638;
- end;
-
- with Vec^.FontInfo[ 94] do begin
- Cdp := round ( 7.9382 * units);
- Cht := 0;
- Cwd := round( 0.9923 * units);
- Angle := -82.8750;
- end;
-
- with Vec^.FontInfo[ 95] do begin
- Cdp := round ( 8.0000 * units);
- Cht := 0;
- Cwd := 0;
- Angle := -90.0000;
- end;
-
- with Vec^.FontInfo[ 96] do begin
- Cht := round( 4.0000 * units);
- Cdp := 0;
- Cwd := 0;
- Angle := 90.0000;
- end;
-
- with Vec^.FontInfo[ 97] do begin
- Cht := round( 3.8806 * units);
- Cdp := 0;
- Cwd := round( 0.9701 * units);
- Angle := 75.9638;
- end;
-
- with Vec^.FontInfo[ 98] do begin
- Cht := round( 3.5777 * units);
- Cdp := 0;
- Cwd := round( 1.7889 * units);
- Angle := 63.4349;
- end;
-
- with Vec^.FontInfo[ 99] do begin
- Cht := round( 3.2000 * units);
- Cdp := 0;
- Cwd := round( 2.4000 * units);
- Angle := 53.1301;
- end;
-
- with Vec^.FontInfo[100] do begin
- Cht := round( 2.8284 * units);
- Cdp := 0;
- Cwd := round( 2.8284 * units);
- Angle := 45.0000;
- end;
-
- with Vec^.FontInfo[101] do begin
- Cht := round( 2.4000 * units);
- Cdp := 0;
- Cwd := round( 3.2000 * units);
- Angle := 36.8699;
- end;
-
- with Vec^.FontInfo[102] do begin
- Cht := round( 1.7889 * units);
- Cdp := 0;
- Cwd := round( 3.5777 * units);
- Angle := 26.5651;
- end;
-
- with Vec^.FontInfo[103] do begin
- Cht := round( 0.9701 * units);
- Cdp := 0;
- Cwd := round( 3.8806 * units);
- Angle := 14.0362;
- end;
-
- with Vec^.FontInfo[104] do begin
- Cht := 0;
- Cdp := 0;
- Cwd := round( 4.0000 * units);
- Angle := 0.0000;
- end;
-
- with Vec^.FontInfo[105] do begin
- Cdp := round( 0.9701 * units);
- Cht := 0;
- Cwd := round( 3.8806 * units);
- Angle := -14.0362;
- end;
-
- with Vec^.FontInfo[106] do begin
- Cdp := round( 1.7889 * units);
- Cht := 0;
- Cwd := round( 3.5777 * units);
- Angle := -26.5651;
- end;
-
- with Vec^.FontInfo[107] do begin
- Cdp := round( 2.4000 * units);
- Cht := 0;
- Cwd := round( 3.2000 * units);
- Angle := -36.8699;
- end;
-
- with Vec^.FontInfo[108] do begin
- Cdp := round( 2.8284 * units);
- Cht := 0;
- Cwd := round( 2.8284 * units);
- Angle := -45.0000;
- end;
-
- with Vec^.FontInfo[109] do begin
- Cdp := round ( 3.2000 * units);
- Cht := 0;
- Cwd := round( 2.4000 * units);
- Angle := -53.1301;
- end;
-
- with Vec^.FontInfo[110] do begin
- Cdp := round ( 3.5777 * units);
- Cht := 0;
- Cwd := round( 1.7889 * units);
- Angle := -63.4349;
- end;
-
- with Vec^.FontInfo[111] do begin
- Cdp := round ( 3.8806 * units);
- Cht := 0;
- Cwd := round( 0.9701 * units);
- Angle := -75.9638;
- end;
-
- with Vec^.FontInfo[112] do begin
- Cdp := round ( 4.0000 * units);
- Cht := 0;
- Cwd := 0;
- Angle := -90.0000;
- end;
-
- with Vec^.FontInfo[113] do begin
- Cht := round( 2.0000 * units);
- Cdp := 0;
- Cwd := 0;
- Angle := 90.0000;
- end;
-
- with Vec^.FontInfo[114] do begin
- Cht := round( 1.7889 * units);
- Cdp := 0;
- Cwd := round( 0.8944 * units);
- Angle := 63.4349;
- end;
-
- with Vec^.FontInfo[115] do begin
- Cht := round( 1.4142 * units);
- Cdp := 0;
- Cwd := round( 1.4142 * units);
- Angle := 45.0000;
- end;
-
- with Vec^.FontInfo[116] do begin
- Cht := round( 0.8944 * units);
- Cdp := 0;
- Cwd := round( 1.7889 * units);
- Angle := 26.5651;
- end;
-
- with Vec^.FontInfo[117] do begin
- Cht := 0;
- Cdp := 0;
- Cwd := round( 2.0000 * units);
- Angle := 0.0000;
- end;
-
- with Vec^.FontInfo[118] do begin
- Cdp := round( 0.8944 * units);
- Cht := 0;
- Cwd := round( 1.7889 * units);
- Angle := -26.5651;
- end;
-
- with Vec^.FontInfo[119] do begin
- Cdp := round( 1.4142 * units);
- Cht := 0;
- Cwd := round( 1.4142 * units);
- Angle := -45.0000;
- end;
-
- with Vec^.FontInfo[120] do begin
- Cdp := round ( 1.7889 * units);
- Cht := 0;
- Cwd := round( 0.8944 * units);
- Angle := -63.4349;
- end;
-
- with Vec^.FontInfo[121] do begin
- Cdp := round ( 2.0000 * units);
- Cht := 0;
- Cwd := 0;
- Angle := -90.0000;
- end;
-
- with Vec^.FontInfo[122] do begin
- Cht := round( 1.0000 * units);
- Cdp := 0;
- Cwd := 0;
- Angle := 90.0000;
- end;
-
- with Vec^.FontInfo[123] do begin
- Cht := round( 0.7071 * units);
- Cdp := 0;
- Cwd := round( 0.7071 * units);
- Angle := 45.0000;
- end;
-
- with Vec^.FontInfo[124] do begin
- Cht := 0;
- Cdp := 0;
- Cwd := round( 1.0000 * units);
- Angle := 0.0000;
- end;
-
- with Vec^.FontInfo[125] do begin
- Cdp := round( 0.7071 * units);
- Cht := 0;
- Cwd := round( 0.7071 * units);
- Angle := -45.0000;
- end;
-
- with Vec^.FontInfo[126] do begin
- Cdp := round ( 1.0000 * units);
- Cht := 0;
- Cwd := 0;
- Angle := -90.0000;
- end;
-
- with Vec^.FontInfo[127] do begin
- Cht := 0;
- Cdp := 0;
- Cwd := 0;
- Angle := -90.0000;
- end;
-
- end; (* define vectors *)
-
-
-
-
- {-------------------------------------------------}
- (* If, for some reason, you do not want to deal with
- music capabilities, replace the body of this procedure
- with just a begin end; pair and also the TylBeam proc.
- *)
- procedure definebeams (* var M : pMusFontInfRec *);
- var i : integer;
- begin
-
- end;
-
- {----------------------------------------------------------}
- (* use pre-calculated coordinates of a circle that has a
- E_O_F
- else
- echo "will not over write ./src/textyl.pas.ac"
- fi
- chmod 644 ./src/textyl.pas.ac
- if [ `wc -c ./src/textyl.pas.ac | awk '{printf $1}'` -ne 21388 ]
- then
- echo `wc -c ./src/textyl.pas.ac | awk '{print "Got " $1 ", Expected " 21388}'`
- fi
- if `test ! -s ./src/textyl.pas.ab`
- then
- echo "writing ./src/textyl.pas.ab"
- cat > ./src/textyl.pas.ab << 'E_O_F'
-
- {---------------------------------------------------}
- procedure Output4Byte (i : integer);
- var tmp : integer;
- begin
- tmp := i;
- if (tmp >= 0) then
- begin
- OutputByte (tmp div TWO24);
- end
- else
- begin
- tmp := tmp + TWO31 + 1; (* need the +1 *)
- OutputByte (tmp div TWO24 + 128);
- end;
- tmp := tmp mod TWO24;
- OutputByte (tmp div TWO16);
- tmp := tmp mod TWO16;
- OutputByte (tmp div 256);
- OutputByte (tmp mod 256);
- end;
-
-
- {---------------------------------------------------}
-
- function rtan (ang : real) : real;
- var rads : real;
- cosrads : real;
- begin
- rads := ang * DEGTORAD;
- cosrads := cos (rads);
- if (cosrads = 0.0) then { this happens at 90 and 270 }
- cosrads := cos ((ang - 0.01) * DEGTORAD);
- rtan := (sin (rads)) / (cosrads);
- end;
-
- {---------------------------------------------------}
- function float (i : integer) : real;
- begin
- float := i + 0.00;
- end;
-
-
- {---------------------------------------------------}
- function tolowercase (let: char) : char;
- const Diff = 32; (* xord['a'] - xord['A'] *)
- var olet : integer;
- begin
- olet := xord[let];
- if (olet >= xord['A']) then
- begin
- if (olet <= xord['Z']) then
- begin
- let := xchr[olet + Diff];
- end;
- end;
- tolowercase := let;
- end;
-
- {---------------------------------------------------}
- (* decide if the first string is the same as the second --
- * at least the first 'len' characters
- * We need this since most Pascal impls. are brain-dead
- * when it comes to string comparisons
- *)
- function streq (a, b : charstring; len : integer) : boolean;
- label 1;
- var i : integer;
- same : boolean;
- begin
- same := true;
- for i := 1 to len do
- begin
- if (a[i] <> b[i]) then
- begin
- same := false;
- goto 1;
- end; (* if *)
- end; (* for *)
- 1:
- streq := same;
- end; (* streq *)
-
- {-------------------------------------------------------}
- procedure strcopy (* src : charstring; var dest : charstring; len : integer *);
- var i : integer;
- begin
- for i := 1 to len do
- dest[i] := src[i];
- end;
-
- {-------------------------------------------------------}
- procedure writestrng (* s :strng; tologfile : boolean *);
- var i : integer;
- begin
- if (tologfile) then
- begin
- for i := 1 to s.len do
- write (logfile, s.str[i]);
- end
- else
- begin
- for i := 1 to s.len do
- write (s.str[i]);
- end;
- end;
-
-
- {---------------------------------------------------}
- (* Move the current DVI position to posx, posy by
- * moving relatively from our current position
- * and store the new position
- *)
-
- procedure isetpos (posx, posy : integer);
- var dy, dx: ScaledPts;
- numbytes : integer;
- begin
- dx := posx - ourxpos;
- dy := posy - ourypos;
-
- numbytes := 1;
- if ((dx < 128) and (dx >= -128)) then
- numbytes := 1
- else if ((dx < 32768) and (dx >= -32768)) then
- numbytes := 2
- else if ((dx < TWO23) and (dx >= - TWO23))then
- numbytes := 3
- else if ((dx < TWO31) and (dx >= - TWO31))then
- numbytes := 4
- else
- begin
- complain (ERRREALBAD);
- writeln('Panic: dx is too big/small in isetpos: ',dx);
- writeln(logfile,'Panic: dx is too big/small in isetpos: ',dx);
- end;
-
- cmd1byte (RIGHTLEFT + numbytes -1); (* number of bytes in its arg list *)
- cmdSigned (dx, numbytes);
-
- numbytes := 1;
- if ((dy < 128) and (dy >= -128)) then
- numbytes := 1
- else if ((dy < 32768) and (dy >= -32768)) then
- numbytes := 2
- else if ((dy < TWO23) and (dy >= - TWO23))then
- numbytes := 3
- else if ((dy < TWO31) and (dy >= - TWO31))then
- numbytes := 4
- else
- begin
- complain (ERRREALBAD);
- writeln('Panic: dy is too big/small in isetpos: ',dy);
- writeln(logfile,'Panic: dy is too big/small in isetpos: ',dy);
- end;
-
- cmd1byte (DOWNUP + numbytes -1);
-
- cmdSigned (dy, numbytes);
-
- ourxpos := posx;
- ourypos := posy;
- end;
-
- {---------------------------------------------------}
- (* put out a character *)
- procedure iputchar (charno : OctByt);
- begin
- cmd1byte (PUT1);
- cmd1byte (charno);
- end;
-
-
- {---------------------------------------------------}
- (* set the font number, but only if it is different than
- * the last one we accessed.
- *)
- procedure isetfont (DVINum : integer);
- begin
- if (ourfontnum <> DVINum) then
- begin
- cmd1byte (USEFONT);
- cmd2byte (DVINum);
- ourfontnum := DVINum;
- end;
- end;
-
-
- procedure IPUSH;
- begin
- if (ourpushdepth = 0) then
- begin (* first push --> start tyling *)
- origTexfont := font[curfont].num;
- end
- else
- begin
- prevfont := ourfontnum; (* store the internal font number in use at this time *)
- end;
- cmd1byte (NOP);
- cmd1byte (NOP); (* our greeting *)
- cmd1byte (PUSH);
- ourpushdepth := ourpushdepth + 1;
- end;
-
- procedure IPOP;
- begin
- cmd1byte (POP);
- cmd1byte(NOP);
- cmd1byte(NOP); (* our signature *)
- ourpushdepth := ourpushdepth - 1;
- if (ourpushdepth < 0) then
- begin
- complain (ERRREALBAD);
- writeln(logfile,'Error: too many internal pops');
- end;
- if (ourpushdepth = 0) then
- begin (* we are totally done with tyling for now *)
- if (nf > 0) then
- isetfont (origTexfont); (* only if it is valid *)
- end
- else
- begin
- if (prevfont >= 0) then
- isetfont(prevfont); (* restore that internal font previously in use *)
- end;
- end;
-
- {---------------------------------------------------}
- (* Assumes that the correct font is currently set *)
- procedure Tyldot (dotx, doty : ScaledPts);
- begin
- if (dotx <> 0) and (doty <> 0) then
- isetpos (dotx, doty);
- iputchar (DOTCHAR);
- end;
-
- {---------------------------------------------------}
- procedure InitDVIBuf;
- var i: integer;
- begin
- with GDVIBuf do
- begin
- TotByteLen := 0;
- Numstrings := 0;
- for i := 1 to MAXDVISTRINGS do
- Dstrings[i] := nil;
- curstrindex := MAXOLEN + 1;
- end;
- end;
-
- {---------------------------------------------------}
- procedure ClearDVIBuf;
- var i : integer;
- begin
- with GDVIBuf do
- begin
- for i := 1 to Numstrings do
- begin
- dispose (Dstrings[i]);
- Dstrings[i] := nil;
- end;
- TotByteLen := 0;
- Numstrings := 0;
- curstrindex := MAXOLEN + 1;
- end;
- end;
-
- {---------------------------------------------------}
- procedure WriteDVIBuf;
- var i: integer;
- curstr: integer;
- b : OctByt;
- begin
- curstr := 1;
- with GDVIBuf do
- begin
- while (curstr < Numstrings) do
- begin
- for i := 1 to MAXOLEN do
- begin
- b := Dstrings[curstr]^[i];
- OutputByte (b);
- end;
- curstr := curstr + 1;
- end; (* while *)
-
- (* now do the last string *)
- for i := 1 to (curstrindex - 1) do
- begin
- b := Dstrings[Numstrings]^[i];
- OutputByte(b);
- end; (* for *)
- end; (* with *)
- ClearDVIBuf;
- end;
-
- {---------------------------------------------------}
- procedure BackupInBuf (nbytes : integer);
- var nstrs, rem : integer;
- begin
- with GDVIBuf do
- begin
- nstrs := (TotByteLen - nbytes) div MAXOLEN;
- rem := (TotByteLen - nbytes) mod MAXOLEN;
- Numstrings := nstrs + 1;
- curstrindex := rem + 1; (* points to position to-be-filled *)
- if (curstrindex = 0) then
- curstrindex := MAXOLEN;
- TotByteLen := TotByteLen - nbytes;
- end;
- end;
-
- {-----------------------------------------------------}
- function DVIMark : integer;
- begin
- DVIMark := GDVIBuf.TotByteLen;
- end;
-
-
-
- {---------------------------------------------}
- function NewItem (what : Primitive): pItem;
- var i : pItem;
- f : figptr;
- begin
-
- new (i);
- with i^ do
- begin
- nextitem := nil;
- BBlx := 0;
- BBby := 0;
- BBrx := 0;
- BBty := 0;
- itemthick := LoVThick;
- itemvec := VKCirc;
- itempatt := solid;
- kind := what;
- case (what) of (* give defaults *)
- Aline : ;
- Aspline: begin
- nsplknots := 0;
- dosmarks := 0;
- sclosed := false;
- spltype := BSPL;
- end;
- Attspline: begin
- nttknots := 0;
- dottmarks := 0;
- tspltype := BSPL;
- tclosed := false;
- end;
- Abeam : ;
- Atieslur: begin
- ntknots := 0;
- end;
- Aarc: begin
- narcknots := 0;
- end;
- Alabel: begin
- fontstyle := -1; (* undefined *)
- labeltext.len := 0;
- end;
- Afigure: begin
- figtheta := 0.0;
- fsx := 1.0; fsy := 1.0;
- fdx := 0; fdy := 0;
- preWid := 0; preHt := 0;
- postWid := 0; postHt := 0;
- depthnumber := 0; (* for now *)
- new (f); (* a new figure *)
- body := f;
- body^.things := nil;
- end;
- end; (*case *)
- end; (* with *)
- NewItem := i;
- end; (* NewItem *)
-
- { ### Note: "pageitems" could be extended to be a list
- { of macrodefinitions which contain primitives , and
- { then could be instanced. E.g., a library of common
- { figures callable from \special level }
-
-
- {------------------------------------------------------}
- procedure pushItem (depth : integer; newthing : pItem);
- label 101;
- var i, p : pItem;
- dun : boolean;
- begin
- if (pageitems = nil) then
- begin
- if (newthing^.kind = Afigure) then
- begin
- pageitems := newthing;
- goto 101;
- end
- else
- begin
- pageitems := NewItem (Afigure);
- pageitems^.depthnumber := depth;
- end;
- end;
-
- (* Assume that pageitems points to Afigure *)
-
- (* traverse the list *)
- i := pageitems; (* point to front of list for now *)
- p := i^.body^.things;
- dun := false;
- while ((p <> nil) and not dun) do
- begin
- if (depth = i^.depthnumber) then
- begin (* simple push *)
- dun := true;
- (* Note: this is the case when pushing another figure item
- onto an already-existing list. We push the newfigure
- with a depth of (fig^.depthnumber - 1) because it
- really is part of the higer-level figure
- *)
- end
- else if (depth > i^.depthnumber) then
- begin
- (* there MUST be a figure with a higher number deeper *)
- while ((p^.kind <> Afigure) and (p^.nextitem <> nil)) do
- begin
- p := p^.nextitem;
- end;
-
- if (p^.kind = Afigure) then
- begin
- i := p;
- p := i^.body^.things;
- end
- else
- begin
- complain (ERRREALBAD);
- writeln(logfile,'OOPS p^.kind isnt a figure. It must be near endoflist');
- end;
- end;
- end; (* while *)
-
- (* we have the correct front of list-list,
- and i points to Afigure item *)
- newthing^.nextitem := p;
- i^.body^.things := newthing;
- 101:
- end; (* pushItem *)
-
-
-
- {---------------------------------------------}
- function Tgetfixword (k: integer) : real;
- var a : 0 .. 4096;
- f : integer;
- begin
- a := (tfm[k] * 16) + (tfm[k + 1] div 16);
- f := ((((tfm[k + 1] mod 16) * 256)
- + tfm[k + 2]) * 256)
- + tfm[k + 3];
- if (a > 2047) then
- begin
- a := 4096 - a;
- if (f > 0) then
- begin
- f := TWO20 - f;
- a := a - 1;
- end;
- end;
- Tgetfixword := a + f / TWO20;
- end;
-
- {-----------------------------------------------------}
- function TgetSigned (k: integer): integer;
- var i: integer;
- begin
- i := tfm[k];
- if (i < 128) then
- i := i - 256;
- TgetSigned := (((((i * 256) + tfm[k + 1]) * 256) +
- tfm[k + 2]) * 256) + tfm[k + 3];
- end;
-
-
-
- {-----------------------------------------------------------}
- (* open a .tfm file and return the parameters in it.
- * Used only in conjuction with the vector and music fonts
- *)
- procedure gettfm (tfmfilnam: strng;
- var dessize, p1, p2, p3, p4, p5, p6, p7 : ScaledPts;
- var cksum : integer);
- label 9999;
- var tfmptr: integer;
- lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np: integer;
- charbase, widthbase, heightbase, depthbase,
- italicbase, ligkernbase, kernbase, extenbase,
- parambase : integer;
- tempdesignsize : ScaledPts;
- begin
- p1 := 0; p2 := 0; p3 := 0; p4 := 0;
- p5 := 0; p6 := 0; p7 := 0;
- cksum := -1;
-
- strcopy(tfmfilnam.str, tfmname.str, tfmfilnam.len);
- tfmname.len := tfmfilnam.len;
-
- tfmname.str[tfmname.len + 1] := chr(32);
-
- if (not opentfmfile) then
- begin
- complain (ERRREALBAD);
- writestrng(tfmname,true);
- writeln(logfile,'---not loaded, TFM file can''t be opened!');
- writestrng(tfmname,false);
- writeln(' cannot be opened. Aborting');
- jumpout;
- end;
-
-
- tfm[0] := Tgetvaxbyte;
- tfm[1] := Tgetvaxbyte;
-
-
- lf := (tfm[0] * 256) + tfm[1];
- if ((4 * lf - 1) > TFMSIZE) then
- begin
- complain (ERRREALBAD);
- write(logfile,'The tfm file:');
- writestrng(tfmfilnam, true);
- writeln(logfile,' is bigger than I can handle!');
- goto 9999;
- end;
-
- for tfmptr := 2 to (4 * lf) - 1 do
- begin
-
- tfm[tfmptr] := Tgetvaxbyte;
-
- end; (* for *)
-
- tfmptr := 2;
- lh := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- bc := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- ec := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- nw := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- nh := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- nd := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- ni := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- nl := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- nk := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- ne := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- np := (tfm[tfmptr] * 256) + tfm[tfmptr + 1];
- tfmptr := tfmptr + 2;
-
- if (lf <> (6 + lh + ((ec - bc) + 1) + nw + nh
- + nd + ni + nl + nk + ne + np)) then
- begin
- complain (ERRREALBAD);
- writestrng(tfmfilnam, true);
- writeln(logfile,': subfile sizes don''t add up to the stated total!');
- writeln(logfile,'Sorry, but I can''t go on; are you sure this is a TFM?');
- goto 9999
- end;
- if (bc > (ec + 1)) or (ec > 255) then
- begin
- complain (ERRREALBAD);
- writeln(logfile,'The character code range ', bc: 1, '..', ec: 1, 'is illegal!');
- writeln(logfile,'Sorry, but I can''t go on; are you sure this is a TFM?');
- goto 9999;
- end;
- charbase := (6 + lh) - bc;
- widthbase := (charbase + ec) + 1;
- heightbase := widthbase + nw;
- depthbase := heightbase + nh;
- italicbase := depthbase + nd;
- ligkernbase := italicbase + ni;
- kernbase := ligkernbase + nl;
- extenbase := kernbase + nk;
- parambase := (extenbase + ne) - 1;
-
- dessize := round (Tgetfixword (28) * SPPERPT); (* now in ScaledPts *)
- tempdesignsize := round (dessize * magfactor);
- cksum := TgetSigned (24);
- (* return the special 7 parameters for the font *)
- p1 := round (Tgetfixword (4 * (parambase + 1)) * tempdesignsize);
- p2 := round (Tgetfixword (4 * (parambase + 2)) * tempdesignsize);
- p3 := round (Tgetfixword (4 * (parambase + 3)) * tempdesignsize);
- p4 := round (Tgetfixword (4 * (parambase + 4)) * tempdesignsize);
- p5 := round (Tgetfixword (4 * (parambase + 5)) * tempdesignsize);
- p6 := round (Tgetfixword (4 * (parambase + 6)) * tempdesignsize);
- p7 := round (Tgetfixword (4 * (parambase + 7)) * tempdesignsize);
-
- 9999:
- end;
-
-
- {---------------------------------------------------}
- procedure initVnMnLtables;
- var i: integer;
- begin
- for i := 1 to SizVFontTable do
- VFontTable[i] := nil;
- for i := 1 to SizMFontTable do
- MFontTable[i] := nil;
- for i := 1 to SizLFontTable do
- LFontTable[i] := nil;
- VFontsDefd := 0;
- MFontsDefd := 0;
- LFontsDefd := 0;
- GDVIFN := 300; (* starting number for any new fonts that we define *)
- end;
-
-
- {-------------------------------------------------------}
- procedure fonttobedefined (kind : char; findex : integer);
- begin
- FTBDs := FTBDs + 1;
- (* reset this to zero after outputting
- 1. fontdefs
- 2. bop
- 3. contents of dvi page
- 4. eop
- *)
- TBD[FTBDs].which := kind;
- TBD[FTBDs].indx := findex;
- end;
-
-
- {-----------------------------------------------------}
- procedure enterfont (fontnum : integer; ck : integer;
- scalefact, dessiz : ScaledPts;
- nam : strng);
- var n: integer;
- len : integer;
- begin
- cmd1byte(FONTDEF);
- cmd2byte(fontnum);
- cmd4byte(ck);
- cmd4byte(scalefact);
- cmd4byte(dessiz);
- cmd1byte(USESTDAREA);
-
- len := nam.len;
-
-
- cmd1byte(len - 4); (* skip the length of the .tfm suffix *)
-
-
- for n := 1 to (nam.len - 4) do
-
- begin (* skip the .tfm suffix *)
- cmd1byte (xord [ nam.str[n] ]);
- end;
- end;
-
-
- {-----------------------------------------------------}
- procedure Outputfont (fontnum : integer; ck : integer;
- scalefact, dessiz : ScaledPts;
- nam : strng);
- var n: integer;
- len : integer;
- begin
- OutputByte(FONTDEF);
- Output2Byte(fontnum);
- Output4Byte(ck);
- Output4Byte(scalefact);
- Output4Byte(dessiz);
- OutputByte(USESTDAREA);
-
- len := nam.len;
-
-
- OutputByte(len - 4);
-
-
- for n := 1 to (nam.len - 4) do
-
- begin (* dont output the default dir prefix, nor the .tfm suffix *)
- OutputByte(xord [ nam.str[n] ]);
- end;
- end;
-
- {-----------------------------------------------------}
- procedure defineNewfonts;
- (* this needs to be done before first access to a font on a page
- later someone else will have to re-define all of them in the postamble *)
- label 99;
- var i, n : integer;
- f : integer;
- begin
- for i := 1 to FTBDs do
- begin
- if (TBD[i].which = 'V') then
- begin
- f := TBD[i].indx;
- with VFontTable[f]^ do
- begin
- if (Isdefined) then
- goto 99;
- Outputfont (DVIFontNum, Cksum, DesSize, DesSize,
- FontName);
- Isdefined := true;
- end; (*with *)
- end (* if *)
- else if (TBD[i].which = 'M') then
- begin (* music font *)
- f := TBD[i].indx;
- with MFontTable[f]^ do
- begin
- if (Isdefined) then
- goto 99;
- Outputfont (DVIFontNum, Cksum, DesSize, DesSize,
- FontName);
- Isdefined := true;
- end; (* with *)
- end (* else *)
- else if (TBD[i].which = 'L') then
- begin (* label font *)
- f := TBD[i].indx;
- with LFontTable[f]^ do
- begin
- if (Isdefined) then
- goto 99;
- Outputfont (DVIFontNum, Cksum, DesSize, DesSize, {### is this right?}
- FontName);
- Isdefined := true;
- end; (* with *)
- end
- else
- begin
- complain (ERRREALBAD);
- writeln(logfile,'Unknown type of font to be defined:"',TBD[i].which,'"');
- end; (* else *)
- 99:
- end; (* for *)
- end;
-
-
- {---------------------------------------------------}
- function GetMusFont (stfsiz, fam : integer) : MusIndex;
- label 20, 99;
- var mustfmnam : strng;
- found, i : MusIndex;
- design, p1, p2, p3, p4, linesp, gwidth, p7 : ScaledPts;
- cksm, r, k : integer;
- begin
- (* see if it already exists *)
- found := 0;
- for i := 1 to MFontsDefd do (* loop through since there are few *)
- with MFontTable[i]^ do
- begin
- if (Staffsize = stfsiz) and
- (Family = fam) then
- begin
- found := i;
- goto 20;
- end;
- end; (* with *)
-
- 20: if (found <> 0) then
- begin
- GetMusFont := found;
- goto 99;
- end;
-
- (* Not here already--go get it *)
- for k := 1 to ARRLIMIT do
- mustfmnam.str[k] := ' ';
-
- r := 0;
-
- mustfmnam.str[r+1] := 'm';
- mustfmnam.str[r+2] := 'u';
- mustfmnam.str[r+3] := 's';
- mustfmnam.str[r+4] := xchr[stfsiz + xord['0']];
- mustfmnam.str[r+5] := xchr[fam + xord['0']];
- mustfmnam.str[r+6] := '.';
- mustfmnam.str[r+7] := 't';
- mustfmnam.str[r+8] := 'f';
- mustfmnam.str[r+9] := 'm';
-
- mustfmnam.str[r+10] := chr(32);
-
- mustfmnam.len := 9 + r;
- gettfm (mustfmnam, design, p1, p2, p3, p4, linesp, gwidth, p7, cksm);
-
- MFontsDefd := MFontsDefd + 1;
- if (MFontsDefd > SizMFontTable) then
- begin
- complain (ERRREALBAD);
- writestrng(mustfmnam, true);
- writeln(logfile,'---not loadable. Size of Music Font table too small');
- writestrng(mustfmnam,false);
- writeln(' cannot be loaded. Too many music fonts. Table too small.');
- jumpout;
- end;
-
- i := MFontsDefd;
- new (MFontTable[i]);
- with MFontTable[i]^ do
- begin
- Staffsize := stfsiz;
- Family := fam;
- DesSize := design;
- strcopy (mustfmnam.str, FontName.str, mustfmnam.len);
- FontName.len := mustfmnam.len;
- Cksum := cksm;
- ghu := round (gwidth / QNOTEGHUS);
- gvu := round (linesp / QNOTEGVUS);
- DVIFontNum := GDVIFN + 1;
- Isdefined := false;
- end;
-
- GDVIFN := GDVIFN + 1;
- (* call someone to do the defns of cdp, cht, cwd foreach beam *)
- definebeams (MFontTable[i]);
- fonttobedefined ('M', i);
- GetMusFont := i;
- 99:
- end;
-
-
- {---------------------------------------------------}
- function GetVectFont (size : VThickness; vk : VectKind) : VecIndex;
- label 20, 99;
- var vectfmnam : strng;
- found, i : VecIndex;
- design, p1, p2, w0, w1, maxveclen, p6, p7 : ScaledPts;
- cksm, r, k : integer;
- begin
- (* see if it already exists *)
- found := 0;
-
- for i := 1 to VFontsDefd do
- with VFontTable[i]^ do
- begin
- if ((psize = size) and
- (vkind = vk)) then
- begin
- found := i;
- goto 20;
- end;
- end; (* with *)
-
- 20:
- if (found <> 0) then
- begin
- GetVectFont := found;
- goto 99;
- end;
-
- (* Not here--go get it *)
- for k := 1 to ARRLIMIT do
- vectfmnam.str[k] := ' ';
-
- r := 0;
-
- case (vk) of
- VKCirc : vectfmnam.str[r+1] := 'c';
- VKVert : vectfmnam.str[r+1] := 'v';
- VKHort : vectfmnam.str[r+1] := 'h';
- end; (*case *)
- vectfmnam.str[r+2] := 'v';
- vectfmnam.str[r+3] := 'e';
- vectfmnam.str[r+4] := 'c';
- if (size <= 9) then
- begin
- vectfmnam.str[r+5] := xchr[size + xord['0']];
- vectfmnam.str[r+6] := '.';
- vectfmnam.str[r+7] := 't';
- vectfmnam.str[r+8] := 'f';
- vectfmnam.str[r+9] := 'm';
-
- vectfmnam.str[r+10] := chr(32);
-
- vectfmnam.len := 9 + r;
- end
- else
- begin
- vectfmnam.str[r+5] := xchr[(size div 10) + xord['0']];
- vectfmnam.str[r+6] := xchr[(size - ((size div 10)*10)) + xord['0']];
- vectfmnam.str[r+7] := '.';
- vectfmnam.str[r+8] := 't';
- vectfmnam.str[r+9] := 'f';
- vectfmnam.str[r+10] := 'm';
-
- vectfmnam.str[r+11] := chr(32);
-
- vectfmnam.len := 10 + r;
- end;
-
- gettfm (vectfmnam, design, p1, p2, w0, w1, maxveclen, p6, p7, cksm);
- VFontsDefd := VFontsDefd + 1;
- if (VFontsDefd > SizVFontTable) then
- begin
- complain (ERRREALBAD);
- writestrng(vectfmnam, true);
- writeln(logfile,'---not loadable. Size of Vector Font table too small');
- writestrng(vectfmnam,false);
- writeln(' cannot be loaded. Too many vector fonts. Table too small.');
- jumpout;
- end;
-
- i := VFontsDefd;
- new (VFontTable[i]);
- with VFontTable[i]^ do
- begin
- vkind := vk;
- psize := size;
- DesSize := design;
- if (vk = VKVert) then
- PenSize := w1
- else
- PenSize := w0;
- PenSize := round (size * (MAXVECLENsp / 16.0));
- MaxVectLen := maxveclen;
- strcopy (vectfmnam.str, FontName.str, vectfmnam.len);
- FontName.len := vectfmnam.len;
- Cksum := cksm;
- Isdefined := false;
- DVIFontNum := GDVIFN + 1;
- end;
-
- GDVIFN := GDVIFN + 1;
-
- definevectors (VFontTable[i]);
- (* someone asked for it, so they must want it, and we should fntdef it *)
- fonttobedefined ('V', i);
- GetVectFont := i;
- 99:
- end;
-
- {----------------------------------------------------------}
- function GetLabFont (style : integer) : integer;
- label 30, 99;
- var labtfmnam : strng;
- found, i : integer;
- design, p1, space, p3, p4, p5, p6, p7 : ScaledPts;
- cksm, r, k : integer;
- begin
- if (style > MAXLABELFONTS) then
- style := 1;
- found := 0;
- for i := 1 to LFontsDefd do
- with LFontTable[i]^ do
- begin
- if (internalnumber = style) then
- begin
- found := i;
- goto 30;
- end;
- end;
- 30:
- if (found <> 0) then
- begin
- GetLabFont := found;
- goto 99;
- end;
- for k := 1 to ARRLIMIT do
- labtfmnam.str[k] := ' ';
-
- r := 0;
-
- labtfmnam.str[r + 1] := 'c';
- labtfmnam.str[r + 2] := 'm';
- case style of
- 1: begin (* cmtt10 *)
- labtfmnam.str[r + 3] := 't';
- labtfmnam.str[r + 4] := 't';
- labtfmnam.str[r + 5] := '1';
- labtfmnam.str[r + 6] := '0';
- k := r + 6;
- end;
- 2: begin (* cmb10 *)
- labtfmnam.str[r + 3] := 'b';
- labtfmnam.str[r + 4] := '1';
- labtfmnam.str[r + 5] := '0';
- E_O_F
- else
- echo "will not over write ./src/textyl.pas.ab"
- fi
- chmod 644 ./src/textyl.pas.ab
- if [ `wc -c ./src/textyl.pas.ab | awk '{printf $1}'` -ne 24667 ]
- then
- echo `wc -c ./src/textyl.pas.ab | awk '{print "Got " $1 ", Expected " 24667}'`
- fi
- echo "Finished archive 7 of 9"
- exit
-